import request from '@/utils/request'

// 查询产品运行监测列表
export function listFundProductOperationMonitor(query) {
  return request({
    url: '/monitor/fundProductOperationMonitor/list',
    method: 'get',
    params: query
  })
}

// 查询产品运行监测详细
export function getFundProductOperationMonitor(id) {
  return request({
    url: '/monitor/fundProductOperationMonitor/' + id,
    method: 'get'
  })
}

// 保存产品运行监测
export function saveFundProductOperationMonitor(data) {
  return request({
    url: '/monitor/fundProductOperationMonitor/save',
    method: 'post',
    data: data
  })
}

// 删除产品运行监测
export function delFundProductOperationMonitor(id) {
  return request({
    url: '/monitor/fundProductOperationMonitor/' + id,
    method: 'delete'
  })
}

// 导出产品运行监测
export function exportFundProductOperationMonitor(query) {
  return request({
    url: '/monitor/fundProductOperationMonitor/export',
    method: 'get',
    params: query
  })
}

// 构建tree
export function buildTree(monitorId) {
  return request({
    url: '/monitor/fundProductOperationMonitor/buildTree',
    method: 'get',
    params: { monitorId }
  })
}

// 保存指标
export function saveIndicator(data) {
  return request({
    url: '/monitor/fundProductOperationMonitor/saveIndicator',
    method: 'post',
    data: data
  })
}

// 校验报告期是否存在
export function checkReportDoesItExist(fundId, year, quarterly) {
  return request({
    url: '/monitor/fundProductOperationMonitor/checkReportDoesItExist/' + fundId + '/' + year + '/' + quarterly,
    method: 'get'
  })
}
